package cn.jsu.oj.judgment;


import cn.jsu.oj.judgment.thread.ApplyTaskThread;
import cn.jsu.oj.judgment.thread.SendBoxApplyThread;
import cn.jsu.oj.judgment.thread.SendResultThread;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class JudgmentApplication  implements CommandLineRunner {

    public static void main(String[] args) {
        SpringApplication.run(JudgmentApplication.class, args);
    }

    @Override
    public void run(String... args) throws Exception {
        new Thread(() -> new ApplyTaskThread().run(), "DispatchThread1").start();

        new Thread(() -> new SendBoxApplyThread().run(),"SendBoxApply").start();
        new Thread(() -> new SendResultThread().run(), "SendResultThread").start();

        //这样写有Bug，不知道为啥
//        new Thread(() -> {
//            JudgeUnixServer server=  new JudgeUnixServer();
//            server.start();
//        }).start();
    }
}
